import logging
logging.basicConfig(level=logging.INFO)

# 函数装饰器
def loggingDecorator(func):
    """记录日志的装饰器"""

    def wrapperLogging(*args, **kwargs):
        logging.info("开始执行 %s() ..." % func.__name__)
        func(*args, **kwargs)
        logging.info("%s() 执行完成！ " % func.__name__)
    return wrapperLogging

# def showInfo(*args, **kwargs):
#     print("这是一个测试函数，参数： ", args, kwargs)
# #=test==============================
# decoratedShowInfo = loggingDecorator(showInfo)
# decoratedShowInfo('arg1', 'arg2', kwarg1 = 1, kwarg2 = 2)

# #=test2=============================
@loggingDecorator
def showInfo(*args, **kwargs):
    print("这是一个测试函数，参数： ", args, kwargs)
    
showInfo()